n=1000; m=100; k=35; tube=[|877,27,30| 632,4,97| 294,32,57| 848,3,98| 793,9,84| 896,39,96| 99,45,53| 954,42,86| 776,72,79| 602,38,100| 12,68,70| 217,98,100| 257,61,75| 905,65,70| 333,90,92| 543,41,84| 854,32,52| 837,45,73| 943,73,83| 208,11,20| 364,16,22| 525,68,71| 680,33,92| 238,37,80| 805,78,98| 425,55,67| 178,98,100| 263,83,99| 440,63,67| 499,67,74| 362,25,96| 139,64,84| 38,87,100| 1,0,2| 3,93,99|]; X=[4,7,95,14,6,13,9,16,13,10,9,5,13,8,6,12,15,13,2,18,15,17,12,14,10,11,8,4,1,10,15,8,13,2,2,14,8,14,18,2,8,4,5,10,14,7,17,13,10,18,11,2,1,12,16,5,3,13,9,12,15,6,8,18,11,2,6,17,11,2,15,8,8,3,19,18,7,3,1,11,11,9,12,18,8,7,19,18,11,3,11,17,19,9,14,7,10,17,15,15,9,3,10,15,17,2,13,1,15,8,6,10,3,8,19,17,18,13,17,4,4,19,1,8,9,2,3,4,12,3,10,13,15,14,14,7,18,10,19,12,9,15,18,13,6,15,11,2,11,15,9,16,1,3,1,1,2,14,11,4,18,7,1,11,19,13,4,11,11,17,5,14,14,19,14,18,15,17,9,4,11,12,18,12,17,17,8,2,15,3,16,14,19,5,16,13,18,14,6,3,16,17,5,18,15,6,15,1,8,17,9,4,12,17,2,13,13,11,6,15,3,13,17,7,14,3,10,1,18,10,13,7,11,18,3,14,7,19,16,4,3,4,6,9,1,16,18,13,16,3,1,4,17,9,3,17,14,14,1,1,15,10,16,19,11,11,11,16,11,15,16,14,9,7,8,6,2,13,12,7,4,12,6,19,12,3,19,11,3,10,3,10,7,14,5,19,16,18,15,12,5,8,11,8,16,1,9,15,3,9,8,11,15,15,1,13,18,6,18,19,5,4,19,6,3,2,18,7,14,19,6,16,12,9,5,19,17,19,18,11,16,7,1,2,12,6,13,17,16,12,11,7,11,2,5,4,2,8,1,13,10,3,14,4,5,9,1,1,15,14,13,16,4,13,10,6,2,15,4,4,8,1,1,13,18,8,17,6,2,18,2,1,9,12,10,18,1,4,13,10,17,3,15,12,1,1,15,15,12,13,19,17,4,17,13,7,19,2,12,5,4,5,3,16,3,10,14,18,4,13,13,1,3,4,15,17,6,8,17,16,6,15,10,16,2,1,3,4,19,13,8,4,11,18,11,1,14,16,5,7,15,15,6,18,3,10,17,17,1,9,4,4,2,14,6,7,6,14,16,6,17,3,5,19,12,9,14,4,6,16,13,5,1,3,2,12,1,9,7,4,13,9,18,16,4,9,8,11,3,2,18,2,1,19,15,3,12,9,14,8,11,11,5,7,12,8,14,5,13,14,1,10,18,15,1,10,17,6,18,2,13,16,12,11,15,10,16,17,15,7,9,19,10,1,14,18,8,8,6,2,2,9,8,8,14,12,4,3,14,18,3,12,4,4,13,6,9,5,16,14,17,11,11,11,13,10,2,19,12,8,1,12,5,19,19,5,10,16,3,3,12,5,7,12,19,1,9,2,3,8,5,14,2,9,11,12,16,10,16,15,14,5,3,10,2,4,1,14,5,18,10,13,4,2,18,9,10,12,16,13,10,17,11,8,10,5,13,18,14,12,13,1,11,14,6,18,1,3,3,17,13,5,13,18,18,15,5,11,18,15,10,13,5,12,18,12,7,10,12,19,12,19,1,8,12,16,13,6,17,18,19,4,17,19,15,16,7,19,3,2,6,10,19,7,6,9,5,7,18,11,2,16,19,11,18,9,7,13,10,16,1,16,10,4,6,15,15,11,4,9,11,3,13,16,12,12,10,12,8,2,4,17,4,6,4,6,5,5,1,14,7,3,10,13,6,9,4,4,8,8,19,3,18,15,6,8,11,6,1,13,7,12,4,15,2,1,13,19,10,6,1,5,1,6,6,5,16,1,9,6,11,6,8,11,15,7,5,1,18,3,2,13,4,11,5,19,2,16,6,18,15,10,13,1,13,11,10,5,14,3,12,9,1,14,6,1,13,16,17,10,17,1,19,17,18,9,11,17,19,11,19,19,18,15,9,6,4,10,6,12,16,10,12,15,15,10,16,8,1,8,2,12,13,1,2,18,8,2,13,8,18,3,3,3,7,9,17,7,16,3,16,12,6,1,6,7,18,12,16,16,2,7,1,2,17,14,5,11,13,6,12,16,1,7,19,12,5,12,6,18,14,10,12,2,5,18,15,3,19,6,8,12,14,11,13,19,15,18,6,6,4,3,15,12,10,9,12,1,17,6,14,11,10,10,6,18,16,6,2,2,11,2,4,6,8,7,9,8,4,7,9,15,18,9,14,4,13,6,5,13,19,13,17,4,11,7,9,18,16,4,11,9,12,17,3,5,8,3,9,19,10,17,1,5,19,1,15,12,1,14]; Y=[10,5,6,4,11,14,5,13,4,9,7,11,8,15,5,6,15,18,4,4,8,4,10,6,1,15,15,17,11,3,2,7,18,14,19,13,12,16,8,9,13,12,7,5,19,7,12,7,15,8,12,15,12,19,13,4,5,8,19,3,16,12,19,17,16,2,19,6,6,7,6,18,1,16,11,14,2,14,17,11,13,16,3,1,17,4,11,7,1,7,18,18,19,19,17,5,12,18,15,3,19,9,1,18,18,6,19,12,9,9,11,12,7,17,3,5,19,9,9,14,5,16,19,13,12,11,9,5,11,8,19,9,6,12,17,14,3,19,17,5,10,8,18,8,15,13,8,6,15,2,18,7,6,19,11,6,16,16,7,17,16,9,8,11,6,8,6,2,14,11,18,6,8,5,19,9,5,16,5,8,13,11,4,10,10,18,11,18,1,6,18,12,11,9,5,4,6,16,7,19,17,1,18,1,17,12,1,12,5,1,10,4,15,14,16,14,11,15,9,2,17,15,13,3,4,19,4,19,17,16,4,4,17,16,13,5,4,5,3,7,6,13,4,4,18,10,3,6,11,18,13,8,19,10,12,5,1,1,19,1,17,13,4,13,18,12,11,8,5,13,12,10,9,9,8,19,12,14,9,4,15,14,8,13,11,5,17,5,18,10,15,1,19,19,2,8,11,18,14,7,14,4,18,10,17,15,7,13,7,7,8,1,6,10,7,2,1,9,10,12,16,13,19,18,14,10,12,13,2,14,12,4,18,8,5,9,3,16,2,1,12,11,10,15,1,17,18,5,6,18,8,8,3,6,12,17,10,2,9,9,19,3,19,11,13,15,12,8,2,19,14,14,1,1,6,16,8,16,18,9,9,9,1,12,4,12,1,2,15,8,5,19,15,13,15,18,15,18,16,11,15,14,6,13,11,18,1,1,7,3,11,19,17,16,5,10,7,11,13,9,2,15,19,11,6,18,7,17,12,14,16,12,2,11,5,15,2,5,4,16,6,19,10,10,6,15,18,5,4,11,10,14,11,5,11,16,15,1,9,4,8,17,18,2,11,7,13,5,13,8,10,14,16,4,18,17,2,8,9,15,15,14,19,2,8,13,10,13,15,8,19,18,15,16,8,18,11,5,8,16,12,4,9,2,9,16,11,8,13,4,10,18,11,7,19,5,8,7,2,17,17,18,2,7,5,7,6,11,1,9,14,9,18,12,1,11,1,18,9,10,9,4,17,5,6,12,1,14,9,12,13,3,6,8,19,5,11,16,16,1,8,14,6,1,11,4,12,13,4,8,16,7,17,9,2,11,14,14,9,8,3,1,10,5,9,12,18,2,19,5,13,6,13,17,10,16,12,17,4,12,9,10,1,19,19,16,10,10,18,2,9,11,11,1,8,1,16,19,18,12,16,1,7,5,14,3,17,2,3,13,10,3,19,16,17,12,13,12,19,14,16,10,11,12,6,16,14,16,19,9,17,3,10,4,8,12,15,8,7,9,18,3,3,7,7,12,12,12,6,1,13,7,12,4,9,8,13,16,8,11,11,16,10,15,19,18,6,14,14,15,7,3,10,9,18,7,15,7,7,14,14,15,12,16,2,5,9,2,6,13,4,8,15,18,12,2,18,3,19,15,2,3,4,5,11,7,11,11,2,2,14,14,16,19,9,10,8,16,15,14,13,18,6,7,11,14,8,14,2,13,6,17,14,18,11,9,3,5,9,12,13,2,8,18,9,12,10,18,19,7,2,11,16,12,19,18,3,8,14,15,14,8,10,2,18,13,16,17,12,11,6,4,5,15,14,12,11,5,6,4,7,14,13,12,16,16,5,7,5,18,5,19,10,8,4,11,2,10,16,16,18,11,5,3,12,1,11,3,17,10,2,7,6,13,16,10,17,11,11,2,11,13,15,16,6,6,4,3,4,4,18,7,8,8,6,15,9,12,19,10,10,2,2,15,13,17,9,19,16,8,14,11,10,19,10,8,18,7,7,18,1,4,13,18,5,1,9,17,14,3,6,15,10,16,4,10,4,7,8,16,12,10,8,13,3,17,19,2,13,3,9,15,17,3,7,16,14,16,9,18,18,10,1,19,6,4,9,4,1,10,4,19,5,14,17,14,1,6,9,7,2,9,9,12,15,10,17,8,17,8,7,4,3,1,11,2,17,18,17,9,2,2,1,19,7,3,6,16,11,12,1,8,17,17,7,1,18,7,5,7,7,5,14,13,11,18,15,2,3,1,3,18,15,16,8,11,9,4,6,3];